/***************************************************************************
 *   Copyright (C) 2009 - 2010 by Simon Qian <SimonQian@SimonQian.com>     *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef __VSFUSBD_UVC_H_INCLUDED__
#define __VSFUSBD_UVC_H_INCLUDED__

#include "../../common/UVC/vsfusb_UVC.h"

struct vsfusbd_UVC_control_t;
struct vsfusbd_UVC_control_info_t
{
	uint8_t entity;
	uint8_t selector;
	uint16_t size;

	struct vsfav_control_value_t min;
	struct vsfav_control_value_t max;
	struct vsfav_control_value_t def;

	void (*on_set)(struct vsfusbd_UVC_control_t *control);
};

struct vsfusbd_UVC_control_t
{
	const struct vsfusbd_UVC_control_info_t *info;
	struct vsfav_control_value_t cur;
};

struct vsfusbd_UVC_t
{
	uint8_t ep_in;
	uint16_t control_num;
	struct vsfusbd_UVC_control_t *control;
	struct vsfusbd_desc_filter_t *desc;
	struct vsf_stream_t *video_stream;

	// private
	struct vsfusbd_transact_t IN_transact;
	struct vsfusbd_device_t *device;
	struct vsfusbd_iface_t *iface;
};

extern const struct vsfusbd_class_protocol_t vsfusbd_UVCVC_class;
extern const struct vsfusbd_class_protocol_t vsfusbd_UVCVS_class;

#endif	// __VSFUSBD_UVC_H_INCLUDED__
